﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;
using SWDataDB.DAL;

using SWDataDB.Models;


public partial class InfoTbl_UTIL : System.Web.UI.Page
{
    public string strFid = null;
    public int zkflag = 1, bbflag = 1, bpflag = 1, gpflag = 1, ypflag = 1, xgflag = 1, pmflag = 1,utilflag=1;
    protected void Page_Load(object sender, EventArgs e)
    {
        strFid = Request["fid"];

        if (!IsPostBack)
        {
            if (strFid != null)
            {
                bind();
                //strFid = Request["fid"].ToString();

            }
            
        }

    }


    /// <summary>
    /// 绑定数据
    /// </summary>

    public void bind()
    {

         
        ////////////////////////////////////////////////////////////////////////////////////////钻孔
        DataSet UTILds = new DataSet();
        SWDataDB.DAL.UTILInfo UTILobj = new UTILInfo();
        UTILds = UTILobj.SelectInfoByFileID(strFid);
        UTILGridView.DataKeyNames = new string[] { "ID" };

        DataTable utildt = UTILds.Tables[0];
        DataView utildv = utildt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource utilpds = new PagedDataSource();
        utilpds.DataSource = utildt.DefaultView;//设置数据源(DataTable类型)
        utilpds.AllowPaging = true;
        UTILAspNetPager.RecordCount = utildv.Count;
        utilpds.CurrentPageIndex = UTILAspNetPager.CurrentPageIndex - 1;
        utilpds.PageSize = UTILAspNetPager.PageSize;
        UTILGridView.DataSource = utilpds;
        UTILGridView.DataBind();
        if (UTILds.Tables[0].Rows.Count == 0)
        {
            utilflag = 0;
        }


       


        if (UTILds.Tables[0].Rows.Count == 0)
        {
            utilflag = 0;
        }
        //////////////////////////////////////////////////////////////////////////////////////////////标本
        //DataSet BBds = new DataSet();
        //SWDataDB.DAL.BBInfo BBobj = new BBInfo();
        //BBds = BBobj.SelectInfoByFileID(strFid);

        //BBGridView.DataKeyNames = new string[] { "ID" };
        //DataTable bbdt = BBds.Tables[0];
        //DataView bbdv = bbdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource bbpds = new PagedDataSource();
        //bbpds.DataSource = bbdt.DefaultView;//设置数据源(DataTable类型)
        //bbpds.AllowPaging = true;
        //BBAspNetPager.RecordCount = bbdv.Count;
        //bbpds.CurrentPageIndex = BBAspNetPager.CurrentPageIndex - 1;
        //bbpds.PageSize = BBAspNetPager.PageSize;
        //BBGridView.DataSource = bbpds;
        //BBGridView.DataBind();

        //if (BBds.Tables[0].Rows.Count == 0)
        //{
        //    //BBGridView.Attributes.Add("style", "display:block");
        //    bbflag = 0;
        //}
        //////////////////////////////////////////////////////////////////////////////////////////////薄片
        //DataSet BPds = new DataSet();
        //SWDataDB.DAL.BPInfo BPobj = new BPInfo();
        //BPds = BPobj.SelectInfoByFileID(strFid);

        //BPGridView.DataKeyNames = new string[] { "ID" };


        //DataTable bpdt = BPds.Tables[0];
        //DataView bpdv = bpdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource bppds = new PagedDataSource();
        //bppds.DataSource = bpdt.DefaultView;//设置数据源(DataTable类型)
        //bppds.AllowPaging = true;
        //BBAspNetPager.RecordCount = bpdv.Count;
        //bppds.CurrentPageIndex = BPAspNetPager.CurrentPageIndex - 1;
        //bppds.PageSize = BPAspNetPager.PageSize;
        //BPGridView.DataSource = bppds;
        //BPGridView.DataBind();


        //if (BPds.Tables[0].Rows.Count == 0)
        //{
        //    bpflag = 0;
        //}
        //////////////////////////////////////////////////////////////////////////////////////////////光片
        //DataSet GPds = new DataSet();
        //SWDataDB.DAL.GPInfo GPobj = new GPInfo();
        //GPds = GPobj.SelectInfoByFileID(strFid);

        //GPGridView.DataKeyNames = new string[] { "ID" };


        //DataTable gpdt = GPds.Tables[0];
        //DataView gpdv = gpdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource gppds = new PagedDataSource();
        //gppds.DataSource = gpdt.DefaultView;//设置数据源(DataTable类型)
        //gppds.AllowPaging = true;
        //GPAspNetPager.RecordCount = gpdv.Count;
        //gppds.CurrentPageIndex = GPAspNetPager.CurrentPageIndex - 1;
        //gppds.PageSize = GPAspNetPager.PageSize;
        //GPGridView.DataSource = gppds;
        //GPGridView.DataBind();

        //if (GPds.Tables[0].Rows.Count == 0)
        //{
        //    gpflag = 0;
        //}
        //////////////////////////////////////////////////////////////////////////////////////////////样品

        //DataSet YPds = new DataSet();
        //SWDataDB.DAL.YPInfo YPobj = new YPInfo();
        //YPds = YPobj.SelectInfoByFileID(strFid);

        //YPGridView.DataKeyNames = new string[] { "ID" };

        //DataTable ypdt = YPds.Tables[0];
        //DataView ypdv = ypdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource yppds = new PagedDataSource();
        //yppds.DataSource = ypdt.DefaultView;//设置数据源(DataTable类型)
        //yppds.AllowPaging = true;
        //YPAspNetPager.RecordCount = ypdv.Count;
        //yppds.CurrentPageIndex = YPAspNetPager.CurrentPageIndex - 1;
        //yppds.PageSize = YPAspNetPager.PageSize;
        //YPGridView.DataSource = yppds;
        //YPGridView.DataBind();

        //if (YPds.Tables[0].Rows.Count == 0)
        //{
        //    ypflag = 0;
        //}
        //////////////////////////////////////////////////////////////////////////////////////////////相关资料
        //DataSet XGFds = new DataSet();
        //SWDataDB.DAL.XGInfo XGFobj = new XGInfo();
        //XGFds = XGFobj.SelectInfoByFileID(strFid);

        //XGFGridView.DataKeyNames = new string[] { "ID" };

        //DataTable xgdt = XGFds.Tables[0];
        //DataView xgdv = xgdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource xgpds = new PagedDataSource();
        //xgpds.DataSource = xgdt.DefaultView;//设置数据源(DataTable类型)
        //xgpds.AllowPaging = true;
        //XGFAspNetPager.RecordCount = xgdv.Count;
        //xgpds.CurrentPageIndex = XGFAspNetPager.CurrentPageIndex - 1;
        //xgpds.PageSize = XGFAspNetPager.PageSize;
        //XGFGridView.DataSource = xgpds;
        //XGFGridView.DataBind();

        //if (XGFds.Tables[0].Rows.Count == 0)
        //{
        //    xgflag = 0;
        //}
        //////////////////////////////////////////////////////////////////////////////////////////////剖面

        //DataSet PMds = new DataSet();
        //SWDataDB.DAL.PMInfo PMobj = new PMInfo();
        //PMds = PMobj.SelectInfoByFileID(strFid);

        //PMGridView.DataKeyNames = new string[] { "ID" };


        //DataTable pmdt = PMds.Tables[0];
        //DataView pmdv = pmdt.DefaultView;
        ////对用于分页的类的引用
        //PagedDataSource pmpds = new PagedDataSource();
        //pmpds.DataSource = pmdt.DefaultView;//设置数据源(DataTable类型)
        //pmpds.AllowPaging = true;
        //PMAspNetPager.RecordCount = pmdv.Count;
        //pmpds.CurrentPageIndex = PMAspNetPager.CurrentPageIndex - 1;
        //pmpds.PageSize = PMAspNetPager.PageSize;
        //PMGridView.DataSource = pmpds;
        //PMGridView.DataBind();


        //if (PMds.Tables[0].Rows.Count == 0)
        //{
        //    pmflag = 0;
        //}

    }








    protected void UTILAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        UTILAspNetPager.CurrentPageIndex = e.NewPageIndex;
        bind();
    }
    //protected void BBAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    BBAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void BPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    BPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void GPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    GPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void YPAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    YPAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void PMAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    PMAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
    //protected void XGFAspNetPager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    //{
    //    XGFAspNetPager.CurrentPageIndex = e.NewPageIndex;
    //    bind();
    //}
}